package org.neframework.webtest.service;

import java.util.List;
import java.util.Map;

import org.neframework.webtest.model.t_s_code;

import com.tmsps.neframework.core.common.page.Page;
import com.tmsps.neframework.jpa.base.BaseService;

public class CodeService extends BaseService {

	public static void main(String[] args) {
		CodeService s = new CodeService();
		t_s_code code = s.selectCode("57b6d291-b658-42b0-8b4f-2b574596b55c");
		System.err.println(code.getStatus_verify());
	}

	// 查询验证码
	public List<Map<String, Object>> selectMyCodeList(String srh_name, Page page) {
		String sql = "select * from t_s_code t where t.status=0 and t.verify_name like ? ";
		List<Map<String, Object>> list = jc.queryForList(sql,
				new String[] { "%" + srh_name + "%" }, page);
		return list;
	}

	public t_s_code selectCode(String code) {
		String sql = "select * from t_s_code t where t.status=0 and t.code=? and t.status_verify='待验证' ";
		t_s_code codeInfo = (t_s_code) oc.findObj(sql, new String[] { code },
				t_s_code.class);
		return codeInfo;
	}

}
